<template>
  <view class="content">
    <button class="index" @click="dianji">按钮</button>
  </view>
  <loadingVue ref="loading"></loadingVue>
  <messageVue :col="false" ref="message"></messageVue>
</template>

<script setup lang="ts">
import loadingVue from "@/components/loading.vue";
import messageVue from "@/components/message.vue";
import { ref } from "vue";
import type { Message } from "@/interface/components";
import { onLoad } from "@dcloudio/uni-app";
import { indexs } from "@/api/index";
onLoad(() => {});

const loading = ref<Message.loading>();
const message = ref<Message.toast>();

const dianji = () => {
  loading.value?.show(3);

  indexs({ name: "aa" }).then((res) => {
    loading.value?.hide();
    console.log(res);
  });
};
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .logo {
    color: red;
  }
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
